<template>
  <div id="center">
    <el-descriptions class="margin-top" title="用户信息" direction="vertical" :column="2" :size="size" border>  
    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-user"></i>
        用户名
      </template>
      {{teacher.teacherName}}
    </el-descriptions-item>
    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-user"></i>
        密码
      </template>
      {{teacher.password}}
    </el-descriptions-item>
    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-mobile-phone"></i>
        昵称
      </template>
      {{teacher.nickName}}
    </el-descriptions-item>
    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-location-outline"></i>
        邮箱
      </template>
      {{teacher.email}}
    </el-descriptions-item>
  </el-descriptions>

  </div>
</template>
<script>

export default {
 name:"PersonInfo",

data(){
    return{
        teacher:localStorage.getItem('teacher') ? JSON.parse(localStorage.getItem("teacher")):{}
    }
    
     
 },
 methods:{
     save() {
      //插入或者更新，后端写在了一起，所以这里也可以写在一起
      this.request
        .post("http://localhost:8081/teacher/", this.form)
        .then((res) => {
          if (res.flag=='200') {
            this.$message.success("保存成功");
          } else {
            this.$message.error(res.msg);
          }
        });
    }
 }
}
</script>
<style>
#center{
background-color: rgba(255, 255, 255, 0.481);
width:84%;
height:87%;
position:fixed;

padding:50px 50px;
}/*margin:10% 28%;*/
</style>